<script>
	import {hyh_getPushClientId} from '@/utils/hyh_uni_utils.js'
	export default {
		onLaunch: async function() {
			uni.addInterceptor('switchTab', {
				invoke(e) {
					console.log(e);
				}
			})
			
			try{
				console.log('App Launch')
				uni.showLoading({title: '加载中',mask: true});
				hyh_getPushClientId().then(clientIdRes => {
					const push_clientid = clientIdRes.cid
					console.log('push_clientid: ', push_clientid);
					this.$store.dispatch('updateUserInfo', {push_clientid}).then(res => {
						this.$store.commit('setPushClientid', push_clientid)
					})
				}).catch(err => {
					console.log('push_clientid err: ', err);
				})
				
				await this.$store.dispatch('initUserInfo')
				// this.$store.dispatch('veriftUserInfo')
				
				uni.onPushMessage((res) => {
					console.log("收到推送消息：",res)
				})
			}catch(e){
				//TODO handle the exception
				console.log(e);
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	page {
		--cell-font-size: 28rpx;
		--button-normal-font-size: 28rpx;
		--submit-bar-text-font-size: 28rpx;
		--submit-bar-height: 100rpx;
		--button-default-height: 88rpx;
		--picker-action-font-size: 28rpx;
		--cell-font-size: 30rpx;
		--cell-line-height: 40rpx;
		--cell-vertical-padding: 20rpx;
		--cell-horizontal-padding: 32rpx;
		--picker-action-font-size: 28rpx;
		--picker-action-padding: 0 32rpx;
		--picker-option-font-size: 32rpx;
		--cell-label-font-size: 26rpx;
		--cell-label-line-height: 36rpx;
	}
	.uni-dialog-title-text, .uni-dialog-button-text {
		font-size: 32rpx !important;
	}
	.uni-dialog-title {
		padding-top: 50rpx;
	}
	.uni-popup-dialog {
		width: 600rpx;
	}
	input {
		font-size: 28rpx !important;
	}
</style>
